Catalog handling to filter plans/services in case of cross consumption#207
Conversation
* Parameterized the path that gets registered as broker. * Added settings for supported_platform and osbapi_compliant_name * Catalogs are shown based on the supported_platform * Changed implementation for PlatformManagers, instance assignment is removed from it. * Added new test for K8S catalog * Fixed Quota test which was changing the catalog
|
Hey subhankarc! Thanks for submitting this pull request! All pull request submitters and commit authors must have a Contributor License Agreement (CLA) on-file with us. Please sign the appropriate CLA (individual or corporate). When sending signed CLA please provide your github username in case of individual CLA or the list of github usernames that can make pull requests on behalf of your organization. If you are confident that you're covered under a Corporate CLA, please make sure you've publicized your membership in the appropriate Github Org, per these instructions. Once you've publicized your membership, one of the owners of this repository can close and reopen this pull request, and dreddbot will take another look. |
|
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/155509320 The labels on this github issue will be updated when the story is started. |
CC API version check was added to support 2.8 version. Removing that check now.
| } | ||
|
|
||
| static getPlatformManager(platform) { | ||
| const PlatformManager = (platform && CONST.PLATFORM_MANAGER[platform]) ? require(`./${CONST.PLATFORM_MANAGER[platform]}`) : undefined; |
There was a problem hiding this comment.
attribute name should start with small case here - platformManager
There was a problem hiding this comment.
As it is a class reference, kept it as PlatformManager
| @@ -432,6 +432,9 @@ defaults: &defaults | |||
| secret: 'service-fabrik-blueprint-secret' | |||
There was a problem hiding this comment.
maybe its better to have a new plan to have support for k8s and leave the current one's for cf as the plan name in k8s has to be in different format ?!
There was a problem hiding this comment.
There will not be any new plan. The same existing BOSH plans will be shown for K8S as well.
jagadish-kb
left a comment
There was a problem hiding this comment.
Per discussion please also update the method ensurePlatformContext.
|
|
||
| PLATFORM_MANAGER: { | ||
| 'cloudfoundry': 'CfPlatformManager' | ||
| 'cloudfoundry': 'CfPlatformManager', |
There was a problem hiding this comment.
instead of duping, would it rather make sense to set PLATFORM_ALIAS in context at the top of broker processing? that way we always access the manager class via the alias?
There was a problem hiding this comment.
I have change this and removed the duped ones. Have handled that in the getPlatformManager code.
| @@ -34,20 +33,13 @@ class ServiceBrokerApiController extends BaseController { | |||
| } else { | |||
| throw new PreconditionFailed(`At least Broker API version ${minVersion} is required.`); | |||
| } | |||
There was a problem hiding this comment.
The below ensures that if the calls from CF are coming in, then for the dependencies of SF on CF are checked via this. This might be true always, but nevertheless a check that could help in rarest of scenarios. Obviously if we are never going to increase the version of minCloudControllerApiVersion & we for sure know CF is already upgraded above this version then this check is unnecessary. Nevertheless worth a discussion before removal.
There was a problem hiding this comment.
Post discussion, this is not needed. Keeping this comment for history.
|
|
||
| get platform() { | ||
| return this.context.platform; | ||
| getPlatformSpecificCatalog(catalog) { |
There was a problem hiding this comment.
Platformmanager is to return things platformSpecifc :-), so may be can we strip this from the method name and just keep it getCatalog. Also can return undefined from BasePlatformManager as its implementation from specific manager is absent.
changing the name of method getCatalog in platform specific catalog filtering Removed the duped key values
Also, see cloudfoundry/servicebroker#442 and cloudfoundry/servicebroker#452